home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
wg_lib
/
arryctlf.frm
< prev
next >
Wrap
Text File
|
1995-09-06
|
7KB
|
249 lines
VERSION 2.00
Begin Form ArryCtlFrm
BackColor = &H00C0C0C0&
Caption = "Fast Control Array Operations"
ClientHeight = 4470
ClientLeft = 1185
ClientTop = 1590
ClientWidth = 7470
Height = 4875
Left = 1125
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 4470
ScaleWidth = 7470
Top = 1245
Width = 7590
Begin CommandButton TestCmd
Caption = "Test"
Height = 435
Left = 5475
TabIndex = 13
Top = 3180
Width = 1110
End
Begin Frame VFrame
BackColor = &H00C0C0C0&
Height = 1590
Left = 255
TabIndex = 6
Top = 2580
Width = 4545
Begin ListBox VList
BackColor = &H00C0C0C0&
Height = 810
Left = 165
TabIndex = 8
Top = 660
Visible = 0 'False
Width = 1950
End
Begin TextBox Vres
Height = 555
Left = 2535
MultiLine = -1 'True
TabIndex = 9
Top = 585
Width = 1590
End
Begin ComboBox VCombo
BackColor = &H00C0C0C0&
Height = 300
Left = 210
TabIndex = 7
Top = 225
Width = 1935
End
End
Begin TextBox Msg
Height = 840
Left = 5055
MultiLine = -1 'True
TabIndex = 14
Top = 2010
Width = 2130
End
Begin Frame Cframe
BackColor = &H00C0C0C0&
Height = 885
Left = 5145
TabIndex = 10
Top = 615
Width = 1995
Begin OptionButton CtlOpt
BackColor = &H00C0C0C0&
Caption = "List Control"
Height = 285
Index = 2
Left = 195
TabIndex = 12
Top = 510
Width = 1545
End
Begin OptionButton CtlOpt
BackColor = &H00C0C0C0&
Caption = "Combo Control"
Height = 330
Index = 1
Left = 180
TabIndex = 11
Top = 195
Value = -1 'True
Width = 1575
End
End
Begin Frame IFrame
BackColor = &H00C0C0C0&
Height = 1590
Left = 240
TabIndex = 0
Top = 480
Width = 4500
Begin ListBox IList
BackColor = &H00C0C0C0&
Height = 810
Left = 195
TabIndex = 3
Top = 660
Visible = 0 'False
Width = 1935
End
Begin TextBox IRes
BackColor = &H00FFFFFF&
Height = 555
Left = 2475
MultiLine = -1 'True
TabIndex = 4
Top = 555
Width = 1605
End
Begin ComboBox ICombo
BackColor = &H00C0C0C0&
Height = 300
Left = 180
TabIndex = 2
Top = 210
Width = 1935
End
End
Begin Label Label2
BackColor = &H00C0C0C0&
Caption = "VB Operations"
Height = 285
Left = 285
TabIndex = 5
Top = 2340
Width = 1455
End
Begin Label Label1
BackColor = &H00C0C0C0&
Caption = " WGlib Operations"
Height = 255
Left = 255
TabIndex = 1
Top = 195
Width = 1680
End
End
DefInt A-Z
Dim Arry() As String
Sub CtlOpt_Click (Index As Integer)
If Index = 2 Then
CBClearList ICombo
CBClearList VCombo
VCombo.visible = 0
ICombo.visible = 0
VList.visible = 1
IList.visible = 1
Else
Call LBClearList(IList)
Call LBClearList(VList)
VList.visible = 0
IList.visible = 0
VCombo.visible = 1
ICombo.visible = 1
End If
Ires.text = ""
Vres.text = ""
End Sub
Sub Form_Load ()
' init the array now
ReDim Arry$(1 To 2500)
screen.mousepointer = 11
For x = 1 To UBound(Arry$)
Arry$(x) = "Element " + Str$(x)
Next x
screen.mousepointer = 0
End Sub
Sub Form_Paint ()
ConvexFrm ArryCtlFrm, 4
ConcaveCtl Ires, 3
ConcaveCtl Vres, 3
ConvexCtl CFrame, 3
ConcaveCtl Msg, 4
End Sub
Sub TestCmd_Click ()
Ires.text = ""
Vres.text = ""
Msg.text = ""
If CtlOpt(1).value Then ' Combo
Call CBClearList(VCombo)
CBClearList ICombo
Msg.text = "Doing VB test"
screen.mousepointer = 11
vs! = Timer
For x = 1 To UBound(Arry$)
VCombo.AddItem Arry$(x)
Next x
vel! = Timer - vs!
screen.mousepointer = 0
Vres.text = "Complete. Time: " + Format$(vel!) + " secs"
'errc = CBShowList(VCombo)
VCombo.ListIndex = 0
VCombo.Refresh
Msg.text = "Doing Our test"
ws! = Timer
ArrayToCombo ICombo, Arry$(1), UBound(Arry$)
wel! = Timer - ws!
Ires.text = "Complete. Time: " + Format$(wel!)
'errc = CBShowList(ICombo)
ICombo.ListIndex = 0
ICombo.Refresh
Else
LBClearList VList
LBClearList IList
Msg.text = "Doing VB test"
screen.mousepointer = 11
vs! = Timer
For x = 1 To UBound(Arry$)
VList.AddItem Arry$(x)
Next x
vel! = Timer - vs!
screen.mousepointer = 0
Vres.text = "Complete. Time: " + Format$(vel!) + " secs"
Msg.text = "Doing Our test"
ws! = Timer
ArrayToList IList, Arry$(1), UBound(Arry$)
wel! = Timer - ws!
Ires.text = "Complete. Time: " + Format$(wel!)
End If
Msg.text = "The Complementary operations of Ctl->Array are equally as fast!"
End Sub